package tmp

/**
 * <p>
 * Created by IntelliJ IDEA.
 * User: zslajchrt
 * Date: Nov 2, 2010
 * Time: 9:29:54 AM
 */

class Division {
  var number1: Double = 0

  private[this] var n2: Double = 1
  def number2 = n2
  def number2_=(n: Double) = {
    require(n != 0)
    n2 = n
  }
  def calculate(): Double = {
    print("Dividing " + number1 + " by " + number2)

    val result = number1 / number2

    print("Result is " + result)

    result
  }
}